Graph processing

Back to ece454

Pregel

e.g. Max

3 -> 6
6 -> 3
2 -> 6
2 -> 1
1 -> 2
6 -> 1

e.g. PageRank

void compute(MessageIterator msgs) {
  if (superstep() >= 1) {
    double sum = 0.0;
    for (; !msgs->done(); msgs->next()) {
      sum += msgs->value();
    }
    mutableValue = 0.15 / numVertices + 0.85 * sum;
  }
  if (superstep() < 30) {
    const int64 n = getOutEdgeIterator().size();
    sendMessageToAllNeighbours(getValue() / n);
  } else {
    voteToHalt();
  }
}

Single source shortest paths

A --1-> C
A --3-> B
C --1-> B

Trace:

SS0.
A = 0
B = infinity
C = infinity
A sends 0+3=3 to B
A sends 0+1=1 to C

SS1.
A = 0
B = 3
C = 1
A is unchanged, votes to halt
C sends 1+1=2 to B

SS2.
A = 0
B = 2
C = 1
A is unchanged, votes to halt
C is unchanged, votes to halt
B has no out neighbours, votes to halt

Done

Combiners

Aggregators